
const actions = {
    _increment(context,val) {
        if(context.state.sum % 2){
            context.commit('JIA',val)
        }
    },
    _timeJia(context,val) {
        setTimeout(() => {
            context.commit('JIA',val)
        },500)
    },
}

const mutations = {
    JIA(state,val){
        console.log('JIA',state,val)
        state.sum += val
    },
    JIAN(state,val){
        console.log('JIAN',state,val)
        state.sum -= val
    },

}
const state = {
    sum:0,
    // list:['张三','李四','王五']
}

const getters = {
    nBeiNum(state){
        return state.sum * 10
    }
}

export default {
    namespaced:true,
    actions,
    mutations,
    getters,
    state
}
